<?php foreach($menu as $k=>$v):?>
    <?php if($v['children']):?>
        <li class="_show have-child">
            <a href="javascript:;" data-level="3">
                <div class="icon-nav">
                    <span class="glyphicon glyphicon-triangle-right right"></span>
                    <span class="glyphicon glyphicon-triangle-bottom bottom"></span>
                </div>
                <div class="name">
                    <?php echo $v['title']?>
                </div>
            </a>
            <ul>
                <?php foreach($v['children'] as $val):?>
                    <li>
                        <a href="javascript:;" data-name="<?php echo $v['title']?>" data-loadchild="0" data-src="/<?php echo trim($val['name'],'/')?>" data-level="4" class="menu">
                            <div class="icon-nav"></div>
                            <div class="name">
                                <?php echo $val['title'];?>
                            </div>
                        </a>
                    </li>
                <?php endforeach;?>
            </ul>
        </li>
    <?php else:?>
        <li>
            <a href="javascript:;" data-name="<?php echo $v['title']?>" data-loadchild="0" class="menu" data-id="<?php echo $v['id']?>" data-src="/<?php echo trim($v['name'],'/')?>" data-level="3">
                <div class="icon-nav"></div>
                <div class="name">
                    <?php echo $v['title'];?>
                </div>
            </a>
        </li>
    <?php endif;?>
<?php endforeach;?>